Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor modules: Remove hardcoded magical array size. #705

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

agxpro
Copy link
Contributor

@agxpro agxpro commented Jun 21, 2024

Remove hardcoded std::array size magic number values and replace it with std::to_array and auto to automatically find the size at compile time. Using auto for type wont cause any issue as data type is defined with std::to_array.

This will make easier to add more data and expand the list, now there won't be any need to track no. of items in the list/array.

agxpro added 4 commits June 21, 2024 16:40
AirlineData
AnimalData
BookData
ColorData
CommerceData
CompanyData
ComputerData

Signed-off-by: AnkitGourav <[email protected]>
DatabaseData
DateData
FinanceData
FoodData
HackerData
InternetData
LocationData

Signed-off-by: AnkitGourav <[email protected]>
LoremData
MedicineData
MovieData
MusicData
PersonData
PhoneData
PlantData

Signed-off-by: AnkitGourav <[email protected]>
ScienceData
SportData
SystemData
VideoGameData
VehicleData
WeatherData
WordData

Signed-off-by: AnkitGourav <[email protected]>
Copy link
Owner

@cieslarmichal cieslarmichal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I did not know that was possible!

@cieslarmichal cieslarmichal merged commit 9a8c56e into cieslarmichal:main Jun 21, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants